package com.example.laboratory.ui.laboratory;

import android.os.Bundle;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.example.laboratory.R;
import com.example.laboratory.bean.Laboratory;
import com.example.laboratory.common.Const;
import com.example.laboratory.ui.base.BaseActivity;
import com.example.laboratory.utils.DateUtils;

public class LaboratoryActivity extends BaseActivity {
    @BindView(R.id.lab_id)
    TextView labId;
    @BindView(R.id.lab_label)
    TextView labLabel;
    @BindView(R.id.lab_function)
    TextView labFunction;
    @BindView(R.id.lab_state)
    TextView labState;
    @BindView(R.id.lab_category)
    TextView labCategory;
    @BindView(R.id.lab_safe_status)
    TextView labSafeStatus;
    @BindView(R.id.lab_create_date)
    TextView labCreateDate;
    @BindView(R.id.lab_update_date)
    TextView labUpdateDate;

    @Override
    protected boolean initToolbar() {
        mToolbar.setTitle(R.string.lab_info);
        return true;
    }

    @Override
    protected int getLayoutId() {
        return R.layout.laboratory_layout;
    }

    @Override
    protected void initViews() {
        ButterKnife.bind(this);
        Bundle bundle = this.getIntent().getExtras();
        Laboratory.RowsBean bean = (Laboratory.RowsBean) bundle.getSerializable(Const.BUNDLE_KEY.OBJ);
        labId.setText(bean.getLabid());
        labLabel.setText(bean.getLabel());
        labFunction.setText(bean.getFunction());
        labCategory.setText(bean.getCategory());
        labSafeStatus.setText(bean.getSafeStatus());
        labState.setText(bean.getState());
        labCreateDate.setText(DateUtils.parseTime(bean.getGmtCreate()));
        labUpdateDate.setText(DateUtils.parseTime(bean.getGmtUpdate()));
    }

}
